import panel.ApplicationPanel;
import panel.help.AboutDialog;
import panel.role.texturejsonedit.MapPathConfigurePanel;
import panel.role.texturejsonedit.MaterialTypeConfigurePanel;
import panel.role.xmlgenerate.XmlGeneratePanel;
import util.BeanManager;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

public class MyActionManager implements PropertyChangeListener {
	private final ApplicationPanel panel = BeanManager.getBean(ApplicationPanel.class);

	@Override
	public void propertyChange(PropertyChangeEvent event) {
		String s = event.getPropertyName();
		switch (s) {
			case "XmlGenerate" -> panel.switchContentPanel(BeanManager.getBean(XmlGeneratePanel.class));
			case "MaterialTypeConfigure" ->
					panel.switchContentPanel(BeanManager.getBean(MaterialTypeConfigurePanel.class));
			case "MapPathConfigure" -> panel.switchContentPanel(BeanManager.getBean(MapPathConfigurePanel.class));
			case "AboutApp" -> AboutDialog.showAboutDialog();
		}
	}
}
